/* groom A,B,C, with bride X,Y,Z.
 * A will marry to X, X will marry to C, C will marry to Z.
 * all of the 3 statements are lies.
 * This program finds who will marry whom.
 */


#include<stdio.h>

int main(void){
  int x,y,z;  //for the bride
  for(x=1;x<=3;x++)       //exhausation of x's all possible spouse
    for(y=1;y<=3;y++)     //exhausation of y's all possible spouse
      for(z=1;z<=3;z++)   //exhausation of z's all possible spouse
	if(x!=1&&x!=3&&z!=3&&x!=y&&y!=z&&x!=z)  //satisfy the condition of question
	    {
	      printf("X will marry to %c.\n", 'A'+x-1);
              printf("Y will marry to %c.\n", 'A'+y-1);
              printf("Z will marry to %c.\n", 'A'+z-1);
            }
  return 0;

}
